package org.kd.ssh.web.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.kd.ssh.domain.History;
import org.kd.ssh.service.HistoryService;

import com.opensymphony.xwork2.ActionSupport;

public class HistoryAction extends ActionSupport {
	
	private HistoryService historyService;
	private List<History> histories;
	
	
	public void setHistoryService(HistoryService historyService) {
		this.historyService = historyService;
	}


	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		HttpServletRequest request = ServletActionContext.getRequest();
		String nm = request.getParameter("nm");
		String name = request.getParameter("name");
		String storeId = request.getParameter("store_id");
		
		
		histories = historyService.queryHistroy(nm,name,storeId);
		//request.setAttribute("histories", histories);
		return "queryHistorySuccess";
	}


	public List<History> getHistories() {
		return histories;
	}
	
	
}
